package com.zrrd.jt_admin.common.vo;

import com.zrrd.jt_admin.common.entity.Rule;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author WanJl
 * @version 1.0
 * @title RuleVo
 * @description
 * @create 2024/6/30
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RuleVo extends Rule {

    private Integer level;

    public void setLevel() {
        Integer l=-1;
        if (getMenu()&&getRuleId()==0){
            l=0;
        }else if(!getMenu()&&getRuleId()!=0){
            l=1;
        }else if(getMenu()&&getRuleId()!=0){
            l=2;
        }
        this.level=l;
    }

    @Override
    public String toString() {
        return "RuleVo{" +
                "level=" + level +
                ", id=" + id +
                ", ruleId=" + ruleId +
                ", status=" + status +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", name='" + name + '\'' +
                ", description='" + description + '\'' +
                ", frontpath='" + frontpath + '\'' +
                ", conditions='" + conditions + '\'' +
                ", menu=" + menu +
                ", ordered=" + ordered +
                ", icon='" + icon + '\'' +
                ", method='" + method + '\'' +
                '}';
    }
}
